package mapeamentos.modelo.beans;

import java.io.Serializable;

import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

public class AlunoTextoAulaPK implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 417703528243517750L;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="id_aluno")
	private Aluno aluno;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="id_textoaula")
	private TextoAula textoAula;

	public Aluno getAluno() {
		return aluno;
	}

	public void setAluno(Aluno aluno) {
		this.aluno = aluno;
	}

	public TextoAula getTextoAula() {
		return textoAula;
	}

	public void setTextoAula(TextoAula textoAula) {
		this.textoAula = textoAula;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((aluno == null) ? 0 : aluno.hashCode());
		result = prime * result
				+ ((textoAula == null) ? 0 : textoAula.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AlunoTextoAulaPK other = (AlunoTextoAulaPK) obj;
		if (aluno == null) {
			if (other.aluno != null)
				return false;
		} else if (!aluno.equals(other.aluno))
			return false;
		if (textoAula == null) {
			if (other.textoAula != null)
				return false;
		} else if (!textoAula.equals(other.textoAula))
			return false;
		return true;
	}
}
